From: Colin Walters Date: Tue, 29 Apr 2014 13:02:43 +0000 (-0400) Subject: pull: Correctly handle error state when fetching optional data X-Git-Tag: archive/raspbian/2022.1-3+rpi1~1^2~1206 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=7cc4a20f3bb7a02ac3c1e2d9ef1ed0c9fa49b2f6;p=ostree.git pull: Correctly handle error state when fetching optional data For the static deltas work, we're using the already-extant internal API to perform a HTTP fetch for optional data - static deltas are optional. Except that we didn't correctly unset the error if we were doing an optional fetch and the data wasn't found. --- diff --git a/src/libostree/ostree-repo-pull.c b/src/libostree/ostree-repo-pull.c index 0d9eaf8b..427bd924 100644 --- a/src/libostree/ostree-repo-pull.c +++ b/src/libostree/ostree-repo-pull.c @@ -293,11 +293,14 @@ fetch_uri_contents_membuf_sync (OtPullData *pull_data, run_mainloop_monitor_fetcher (pull_data); if (!fetch_data.result_stream) { - if (allow_noent && g_error_matches (*error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND)) + if (allow_noent) { - g_clear_error (error); - ret = TRUE; - *out_contents = NULL; + if (g_error_matches (*error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND)) + { + g_clear_error (error); + ret = TRUE; + *out_contents = NULL; + } } goto out; }